//
//  DDChoosePositonViewController.m
//  DingDongZP
//
//  Created by Jyh on 16/5/24.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDChoosePositonViewController.h"
//

@interface DDChoosePositonViewController ()

@property (weak, nonatomic) IBOutlet UIButton *qiuzhiButton;
@property (weak, nonatomic) IBOutlet UIButton *zhaopinButton;

- (IBAction)zhaopinButtonClick:(UIButton *)sender;
- (IBAction)qiuzhiButtonClick:(UIButton *)sender;

@end

@implementation DDChoosePositonViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = [UIColor whiteColor];
    self.qiuzhiButton.layer.cornerRadius = 5;
    self.qiuzhiButton.layer.masksToBounds = YES;
    
    self.zhaopinButton.layer.cornerRadius = 5;
    self.zhaopinButton.layer.masksToBounds = YES;
}


- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    self.navigationController.navigationBar.hidden = NO;
}


- (IBAction)zhaopinButtonClick:(UIButton *)sender {
    
    WEAKSELF
    [self showLoadingWithText:@"切换中，请稍候..."];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [weakSelf hideLoading];
        [DDClientInfoManager initClientType:DDClientTypeCattle];
        AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
        [delegate initBossTabbarController];
    });
}

- (IBAction)qiuzhiButtonClick:(UIButton *)sender {
    WEAKSELF
    [self showLoadingWithText:@"切换中，请稍候..."];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [weakSelf hideLoading];
        [DDClientInfoManager initClientType:DDClientTypeCattle];
        AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
        [delegate initCattleTabbarController];
    });
}
@end
